package com.hjqjl.whdemo.feature.feature0.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.blankj.utilcode.util.ImageUtils;
import com.hjqjl.whdemo.R;
import com.hjqjl.whdemo.base.BaseActivity;
import com.hjqjl.whdemo.databinding.ActivityImageBinding;
import com.hjqjl.whdemo.utils.BitmapUtils;

public class ImageActivity extends BaseActivity {
    public static void start(Context context) {
        Intent starter = new Intent(context, ImageActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityImageBinding binding = ActivityImageBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setTitle("图片处理");
        Bitmap mCartoonImage = ImageUtils.getBitmap(R.drawable.home_multiply_cartoon);
        Bitmap mCartoonImage2 = ImageUtils.scale(mCartoonImage, 600, 400);
        Bitmap mBgImage = ImageUtils.getBitmap(R.drawable.home_multiply_bg);
        Bitmap mBgImage2 = ImageUtils.scale(mBgImage, 600, 600);
        Bitmap bitmap = BitmapUtils.setModeMultiply(mCartoonImage2, mBgImage2);
        binding.homeIvImageMultiplyShow.setImageBitmap(bitmap);
    }
}
